<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="favicon.ico"> <link href="./src/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
        <link href="./src/css/font-awesome.css?v=4.4.0" rel="stylesheet">
        <link href="./src/css/plugins/iCheck/custom.css" rel="stylesheet">
        <link href="./src/css/animate.css" rel="stylesheet">
        <link href="./src/css/style.css?v=4.1.0" rel="stylesheet">
        <link href="./src/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
        <script src="./src/js/My97DatePicker/WdatePicker.js"></script>
    </head>
    <body>
        <div class="ibox-content">
            <form class="form-horizontal">
                <input type="hidden" name="m" value="finance">
                <input type="hidden" name="a" value="accountreceivablep">
                <div class="form-group">
                    <label class="col-sm-1 control-label" style="width: 100px;">公司信息：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b"  style="padding-top:2px;">
                            <option value='0' >什么鬼</option>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 100px;">客户简称：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" id="custom_id" name="custom_id" style="padding-top:2px;">
                            <option value='0'>全部</option>
                            <?php foreach ($this->custom as $k => $v) { ?>
                                <option value='<?php echo $v['id'] ?>' <?php echo ($this->custom_id == $v['id']) ? 'selected' : '' ?> ><?php echo $v['nickname'] ?></option>                     
                            <?php } ?>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 125px;">客户联系人：</label>
                    <div class="col-sm-2">
                        <select class="form-control m-b" name="contact" id="contact" style="padding-top:2px;">
                            <option value='0' >全部</option>
                            <?php foreach ($this->contact as $k => $v) { ?>
                                <option value="<?php echo $v['id'] ?>" con="<?php echo $v['custom_id'] ?>" style="display: none;"><?php echo $v['name'] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" style="width: 100px;">状态：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" name="status" style="padding-top:2px;">
                            <option value='0' >全部</option>
                            <option value='1' <?php echo ($this->status == 1) ? 'selected' : ''; ?> >激活</option>
                            <option value='2' <?php echo ($this->status == 2) ? 'selected' : ''; ?> >休眠</option>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 100px;">业务类型：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b" name="servicemode" style="padding-top:2px;">
                            <option value='0'>全部</option>
                            <?php foreach ($this->servicemode as $k => $v) { ?>
                                <option value="<?php echo $v['id'] ?>" <?php echo($this->servicemode_id == $v['id']) ? 'selected' : '' ?> ><?php echo $v['servicemode'] ?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <label class="col-sm-1 control-label" style="width: 125px;">销账状态：</label>

                    <div class="col-sm-2">
                        <select class="form-control m-b"  style="padding-top:2px;">
                            <option value='0'>什么鬼</option>
                        </select>
                    </div>

                    <!--                    <div class="col-sm-1">
                                            <button class="btn btn-sm btn-info" type="submit">搜索</button>
                                        </div>-->
                </div>
                <label class="col-sm-1 control-label" style="width: 100px;margin-left:-15px;">做箱时间：</label>
                <div class="form-group">

                    <div class="col-sm-4">
                        <div class="input-daterange input-group  m-b"  id="datepicker">
                            <input class="input-sm form-control" name="start" onfocus="WdatePicker({skin: 'whyGreen', dateFmt: 'yyyy-MM-dd'})" value="<?php echo $this->start ?>" type="text">
                            <span class="input-group-addon">到</span>
                            <input class="input-sm form-control" name="end"   onfocus="WdatePicker({skin: 'whyGreen', dateFmt: 'yyyy-MM-dd'})"  value="<?php echo $this->end ?>"  type="text">
                        </div>
                    </div>
                    <div class="col-sm-1">
                        <button class="btn btn-sm btn-info" type="submit">搜索</button>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="ibox float-e-margins" style="width:98%;margin-left:1%;">
                <div class="ibox-title">
                    <button class="btn btn-success" style="margin-top:-10px;" type="button" id=""><span class="bold">预览</span></button>
                    <button class="btn btn-success" style="margin-top:-10px;" type="button" id="dao"><span class="bold">导出</span></button>    
                    <button class="btn btn-success" style="margin-top:-10px;" type="button" id=""><span class="bold">自定义</span></button>    
                </div>
                <div class="ibox-content">

                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>序号</th>
                                <th>日期</th>
                                <th>船期</th>
                                <th>客户编号</th>
                                <th>提单号</th>
                                <th>船名/航次</th>
                                <th>箱型/箱量</th>
                                <th>提柜点</th>
                                <th>装卸点</th>
                                <th>还柜点</th>
                                <th>箱号</th>
                                <th>运费</th>
                                <th>落/还箱费</th>
                                <th>打/改单费</th>
                                <th>理货费</th>
                                <th>港杂费</th>
                                <th>坏/污箱费</th>
                                <th>代收费</th>
                                <th>小计</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php 
                            $money_1_sum = 0;
                            $money_5_sum = 0;
                            $money_6_sum = 0;
                            $money_7_sum = 0;
                            $money_10_sum = 0;
                            $money_11_sum = 0;
                            $money_15_sum = 0;
                            $heji_sum = 0;
                            foreach ($this->object as $k => $v) { ?>
                                <tr>
                                    <td><?php echo $v['id']; ?></td>
                                    <td><?php echo $v['createtime']; ?></td>
                                    <td><?php echo $v['ship_date']; ?></td>
                                    <td><?php echo $v['custom_code']; ?></td>
                                    <td><?php echo $v['lading_code']; ?></td>
                                    <td><?php echo $v['cmhc']; ?></td>
                                    <td><?php echo $v['xxxl']; ?></td>
                                    <td><?php echo $v['send_yard_id']; ?></td>
                                    <td><?php echo $v['goods_city']; ?></td>
                                    <td><?php echo $v['back_yard_id']; ?></td>
                                    <td> <?php echo $v['xh'] ?> </td> 
                                    <td> <?php echo $v['money_1'];$money_1_sum += $v['money_1']; ?></td>
                                    <td><?php echo $v['money_5'];$money_5_sum += $v['money_5']; ?></td>
                                    <td><?php echo $v['money_6'];$money_6_sum += $v['money_6']; ?></td>
                                    <td><?php echo $v['money_7'];$money_7_sum += $v['money_7']; ?></td>
                                    <td><?php echo $v['money_10'];$money_10_sum += $v['money_10']; ?></td>
                                    <td><?php echo $v['money_11'];$money_11_sum += $v['money_11']; ?></td>
                                    <td><?php echo $v['money_15'];$money_15_sum += $v['money_15']; ?></td>
                                    <td><?php $heji = ($v['money_1'] + $v['money_5'] + $v['money_6'] + $v['money_7'] + $v['money_10'] + $v['money_11'] + $v['money_15']);
                                    echo $heji;
                                    $heji_sum += $heji;
                                    ?></td>
                                </tr>
                            <?php } ?>
                                <tr style='background:#CEDFF5'>
                                    <td colspan="11" style='text-align:right;'><b>合计:</b></td> 
                                    <td><?php echo $money_1_sum; ?></td> 
                                    <td><?php echo $money_5_sum; ?></td> 
                                    <td><?php echo $money_6_sum; ?></td> 
                                    <td><?php echo $money_7_sum; ?></td> 
                                    <td><?php echo $money_10_sum; ?></td> 
                                    <td><?php echo $money_11_sum; ?></td> 
                                    <td><?php echo $money_15_sum; ?></td> 
                                    <td><?php echo $heji_sum; ?></td>
                                </tr>
                                <tr style='background:#CEDFF5'>
                                    <td colspan="11" style='text-align:right;'><b>合计大写:</b></td>
                                    <td colspan='8'><?php echo get_amount($heji_sum); ?></td>
                                </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="admin-table-page" style="margin-left:20px;">
            <div id="page" class="page">
                <?php echo $this->paging; ?>
            </div>
        </div>
        <div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车队信息新增</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal">
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车队全称：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="name" name="account">
                                </div>
                                <label class="col-sm-2 control-label">车队编号：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="code" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">车队简称：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="nickname" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">地址：</label>
<!--                                  <textarea id="ccommen" name="comment" class="form-control" required="" aria-required="true">
    
                                  </textarea>-->

                                <div class="col-sm-8">
                                    <textarea id="address" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">联系人：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="contact" name="account">
                                </div>
                                <label class="col-sm-2 control-label">联系电话：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="telephone" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">传真号码：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="fax" name="account">
                                </div>
                                <label class="col-sm-2 control-label">邮箱地址：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="email" name="account">
                                </div>

                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">税率：</label>
                                <div class="col-sm-3">
                                    <input class="form-control m-b" id="tax" name="account">
                                </div>
                            </div>
                            <div class="form-group">

                                <label class="col-sm-2 control-label">备注：</label>
                                <div class="col-sm-8">
                                    <textarea id="remark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                </div>
                            </div>

                        </form>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="baocun">保存</button>
                    </div>
                </div>
            </div>
        </div>


        <div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">车队信息修改</h4>
                    </div>
                    <div class="modal-body">
                        <div class="modal-body">
                            <form class="form-horizontal">
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">车队全称：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="uname" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">车队编号：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ucode" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">车队简称：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="unickname" name="account">
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">地址：</label>


                                    <div class="col-sm-8">
                                        <textarea id="uaddress" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">联系人：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ucontact" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">联系电话：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="utelephone" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">传真号码：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="ufax" name="account">
                                    </div>
                                    <label class="col-sm-2 control-label">邮箱地址：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="uemail" name="account">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">税率：</label>
                                    <div class="col-sm-3">
                                        <input class="form-control m-b" id="utax" name="account">
                                    </div>
                                </div>
                                <div class="form-group">

                                    <label class="col-sm-2 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <textarea id="uremark" name="comment" class="form-control" required="" aria-required="true"></textarea>
                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-white" id="gb" data-dismiss="modal">关闭</button>
                        <button type="button" class="btn btn-primary" id="ubaocun">保存</button>
                    </div>
                </div>
            </div>
        </div>
        <script src="./src/js/jquery.min.js?v=2.1.4"></script>
        <script>
         $(function(){
             $("#dao").click(function(){
                location.href = "./?m=finance&a=accountreceivablep&type=2";
             });
         });
        </script>
    </body>
</html>
